package cn.cuit.gyl.service.quartz.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * Spring Quartz 示例
 * 第一种，作业类继承自特定的基类：org.springframework.scheduling.quartz.QuartzJobBean
 */
public class Job3 extends QuartzJobBean {

    private int timeout;
    private static int i = 0;
    //调度工厂实例化后，经过timeout时间开始执行调度
    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        System.out.println("定时任务执行中…");
    }
}
